<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ include file="include/taglib.jsp"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>分级诊疗平台</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" href="${ctxStatic }/css/index.css" />
		<script type="text/javascript" src="${ctxStatic }/js/jquery.min.js" ></script>
		<script src="${ctxStatic }/js/index.js"></script>
		<script type="text/javascript" src="${ctxStatic}/layer/layer.js"></script>
		
		<script type="text/javascript">
			$(function(){
				var bodyWidth=$('body').outerWidth(),
					cotWidth=$('.container').outerWidth(),
					asideWidth=$('.aside').outerWidth(),
					sysHeight=$('.menu-sys').outerHeight(),
					leftWidth=$('.arrow-left').width(),
					left=(bodyWidth-cotWidth)/2;
					innWidth=cotWidth-asideWidth;
					listWdth=innWidth-leftWidth*2-4;
					$('.container').css('left',left);
					$('.content').css('width',innWidth);
					$('.clip-list').css('width',listWdth)
				
			})
		</script>
	</head>
	<body>
		<div class="wallpapper">
			<div class="papper"></div>
			<div class="container">
				<div class="head">
					<div class="logo"><img src="${ctxStatic }/images/logo.png" alt="" /></div>
					<div class="op-box">
						<div class="user-box">
							<div class="user"><img src="${ctxStatic }/images/head.png" alt="" /></div>
							<div class="opr">${userName }</div>
						</div>
					</div>
				</div>
				<div class="main-content clearfix">
					<div class="aside">
						<div class="menu-sys">
							<ul>
								<c:forEach items="${systemList }" var="system" varStatus="i">
									<li    <c:if test="${system.sysPermission==0 }">class="disabled"</c:if> ><a  href="javascript:void(0)"> <i></i> ${system.systemName }<div class="tri"></div></a></li>
								</c:forEach>
							</ul>
						</div>
						<div class="menu-detail">
							<div class="wall-back"></div>
							<div class="sys-item-wrap">
					<c:forEach items="${systemList }" var="system" varStatus="i">
			<script type="text/javascript">						
			$(function(){
			    $.ajax({  
			        type: "GET",  
			        async: false,//同步
			        url: "${ctx}/getMenu?sysId=${system.id}",
			        dataType:"json", 
			        success:function(data){
			        	var menuStr="";
			        	for(var i=0;i<data.data.length;i++){
			        		//var thisMenu='<li>' + '<a href="javascript:void(0)"><i class="nav-icon"></i>' + data.data[i].name + '<span class="glyphicon glyphicon-plus"></span></a>'
			        		var thisMenu='<div class="menu-line"></div><li><a href="javascript:void(0)">'+data.data[i].name+'<span class="arrow"></span></a>';
			        		thisMenu+='<ul>'
			        		if(data.data[i].userMenu!=null){
				        		for(var j=0;j<data.data[i].userMenu.length;j++){
				        				thisMenu=thisMenu + '<li><a href="${system.systemUrl}'+data.data[i].userMenu[j].url+'" target="myIframe" data-options="'+data.data[i].userMenu[j].name+',${system.systemUrl}'+data.data[i].userMenu[j].url+'" >'+data.data[i].userMenu[j].name+'</a></li>';
				        		}
			        		}
			        		thisMenu=thisMenu + '</ul></li>' ;
			        		menuStr=menuStr + thisMenu;
			        	}
			    		$("#dynamicMenu${i.count }").html(menuStr+'<div class="menu-line"></div>'); 
			    		<c:if test="${(systemList)!= null && fn:length(systemList) == i.count}">
		    				loadMenu();
			    		</c:if>
			    		
			        },  
			        error:function(data){  
			     		alert("页面上发生了一个错误!");
			        }  
			     });
			})
			</script>								
							<div class="wrap sys-item">
								<p class="top-title">
								<c:set value="" var="memos" />
								<c:if test="${fn:contains(system.memo,'|')}">
									<c:set value="${ fn:split(system.memo, '|') }" var="memos" />
									<c:forEach items="${memos }" var="s" begin="0" end="0">
									${ s } <br />
									</c:forEach>
								</c:if>
								</p>
								<div class="top-line"><div class="line-color"></div></div>
								<div class="padding-10">
									<h4>${system.systemName }</h4>
									<p>
										<c:choose>
	   									<c:when  test="${fn:contains(system.memo,'|')}">
												<c:forEach items="${memos }" var="s" begin="1" end="1">
												${ s } <br />
												</c:forEach>
										 </c:when>
	   										<c:otherwise> 
	   											${system.memo }
											</c:otherwise>
										</c:choose>
									</p>
								</div>
								<div class="menu-box">
									<div class="menu-title padding-10">
										<i class="nav-icon"></i><span>系统导航</span>
									</div> 
									<div class="menu-list">
										<ul id="dynamicMenu${i.count }">
											<!-- 动态添加菜单 -->
										</ul> 
									</div>
								</div>
							</div>
				</c:forEach>
							</div>
							</div>
					</div>
					<div class="content">
						<!--页签栏-->
						<div class="clip-box">
							<div class="clip-item arrow-left arrow"><i></i></div>
							<div class="clip-item clip-list" id="clip-list">
								<!--<div class="clip active"><a href="">上转申请</a><span></span></div>
								<div class="clip"><a href="">下转申请</a><span></span></div>-->
							</div>
							<div class="clip-item arrow-right arrow"><i></i></div>
						</div>
						<div class="iframe-box">
							<iframe src="" frameborder="0" border="no" name="myIframe" id="myIframe"></iframe>
						</div>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>
